<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>修改密码</title>
    <link rel="stylesheet" href="/layui/css/layui.css">
    <!--<script src="/layui/layui.js"></script>-->
    <script src="/js/jquery-1.8.3.min.js"></script>
</head>
<body>
<div class="layui-layout layui-layout-admin">
    <!--横切菜单-->
    <div th:replace="moban::h_menu"></div>
    <!--纵切菜单-->
    <div th:replace="moban::v_menu"></div>
    <!--内容主体-->
    <div class="layui-body">
        <div class="layui-row">
            <div class="layui-col-xs6 layui-col-md12" style="background-color: aqua ; height: 100px" >
                <div class="grid-demo grid-demo-bg2" style="text-align: center;color: red;font-size: 80px;font-weight: bold">修改密码</div>
            </div>
        </div>
        <form class="layui-form" action="" id="from2">
            <div class="layui-form-item">
                <label class="layui-form-label">会员名:</label>
                <div class="layui-input-block">
                    <input type="text" name="mname" id="mname" th:value="${session.mname}"   lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">密码:</label>
                <div class="layui-input-block">
                    <input type="text" name="mpassword" id="mpassword" th:value="${session.mpassword}" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">新密码:</label>
                <div class="layui-input-block">
                    <input type="text" name="newmpassword" id="newmpassword" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-input-block">
                <button class="layui-btn layui-btn-normal" type="button" style="width: 100px;" id="e">保存</button>
                <button class="layui-btn layui-btn-primary" type="button" style="width: 100px;"id="can">取消</button>
            </div>
        </form>
    </div>
    <!--底部固定区域-->
    <div th:replace="moban::foot"></div>
</div>
<script>
    $("#e").click(function () {
        var mname=$("#mname").val();
        var newmpassword=$("#newmpassword").val();
        $.post('updatePassword',{"mname":mname,"newmpassword":newmpassword},function (a) {
            if(a==1){
                alert("修改密码成功");
                location.reload();
            }
        })
    })
</script>
</body>
</html>